package cn.broadsense.web.factory;

import cn.broadsense.common.utils.spring.SpringUtils;
import cn.broadsense.system.domain.SysNotice;
import cn.broadsense.system.service.ISysNoticeService;
import lombok.extern.slf4j.Slf4j;

import java.util.TimerTask;

/**
 * @author huangjinshi
 * @description
 * @createDate 2024-09-27 15:21:10
 */
@Slf4j
public class AdminAsyncFactory {

    public static TimerTask recordNotice(final SysNotice sysNotice) {

        return new TimerTask() {
            @Override
            public void run() {
                SpringUtils.getBean(ISysNoticeService.class).insertNotice(sysNotice);
            }
        };
    }
}
